package cn.hsa.xxx.api.service;

import java.util.Set;

public interface DiscountService {

    //存放折扣优惠券信息的map
//    public static Map<String, Object> discountMap = new HashMap<>();
    //不可叠加类型的券
    String NO_SUPER_DISCOUNT = "noSuperDiscount";
    //满减类型的券
    String FULL_DISCOUNT = "fullDiscount";

    //折扣类型
    String  DISCOUNT_TYPE = "discountType";
    //是否叠加
    String  ALLOW_OVERLAY_FLAG = "allowOverlayFlag";
    //享受优惠的指标值
    String  INDEXES = "indexes";
    //优惠值
    String  PREFERENTIAL_VALUE = "preferentialValue";



    /**
     * 把优惠券id对应的优惠券属性放入redis
     * 设置hash值，并设置过期时间
     * @param time 过期时间
     * @return
     */
    public Boolean setDiscount(long time);


    /**
     * 获取hash中的值
     * @param keyId 优惠券id
     * @param hashKey 优惠券属性
     * @return
     */
    public Object getDiscount(String keyId, String hashKey);


    /**
     * 将id与优惠券对应的书籍类型绑定，只存放折扣券
     * @param time
     * @return
     */
    public Boolean setIdOfType(long time);


    public Set<String> getIdOfType(String bookTypeName);
}
